package grape.attend.service.user.api;

import grape.attend.service.user.po.UserVacationSum;
import grape.common.service.common.IBaseService;

/**
 * <p>
 * 用户假期余额表 服务类
 * </p>
 *
 * @author yangwei
 * @since 2020-05-18
 */
public interface IUserVacationSumService extends IBaseService<UserVacationSum> {

    /**
     * 根据用户id和假期id查询用户假期余额
     * @param userId
     * @param vacationId
     * @return
     */
    default UserVacationSum getByUserIdAndVacationId(String userId, String vacationId) {
        assertParamNotEmpty(userId,"userId 不能为空");
        assertParamNotEmpty(vacationId,"vacationId 不能为空");
        UserVacationSum userVacationSum = new UserVacationSum();
        userVacationSum.setUserId(userId);
        userVacationSum.setVacationId(vacationId);
        return getOne(userVacationSum);
    }
}
